GenerativeComponents Help

Constructors and initializing nodes

Nodes need to be constructed and initialized in order to be usable in a scripting and programming environment. The first step is to define a variable of the type of the node that is to be created. Once the variable is defined one can call the constructor to create the node itself. A line would look like this then.

	Point pt = new Point();

Usually the default constructor is the Type name followed by parenthesis. There are different forms of constructor methods depending on whether one passes arguments to the constructor or not. For instance, to make a node a sub-node in GenerativeComponents one can pass the keyword 'this', or the name of another node, as an input argument to the constructor.

	Point pt = new Point(this);

To make an node a top-level node in GenerativeComponents one can pass the name of the node within quote marks as an input argument to the constructor.

	Point pt = new Point('scriptedPoint');

All constructor methods of a node are listed in the Expression Builder window under the Node Types tab.

Once an node has been constructed it still needs to be initialized to populate its properties and give it a non-null value.

Just below the constructor methods are the initialization methods or techniques. The next step after constructing an node is to initialize it. This populates the properties of a node with the values passed in as input values when the technique is called.